﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="Orderpage.aspx.cs" Inherits="TCV_WEB.Admin.Page.Orderpage" Title="Untitled Page" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlacebody" runat="server">

    <script language="javascript" type="text/javascript">
function validform(){    
	if(ValidateForm('tblManageProduct','divError','ctl00_ContentPlacebody_')==false)  return false;
	if(EmailCheck('tblManageProduct','divError')==false)  return false;		
	return true;
} 
    </script>

    <table border="0" style="width: 100%; table-layout: fixed;">
        <tr>
            <td align="center">
                <asp:Label ID="lblErr" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="formTitle" align="center">
                Danh sách đơn đặt hàng
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                </telerik:RadScriptManager>
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
                    AllowSorting="True" GridLines="None" Skin="Office2007" AutoGenerateColumns="False"
                    OnNeedDataSource="RadGrid1_NeedDataSource" OnDetailTableDataBind="radgridOrder_DetailTableDataBind"
                    ShowGroupPanel="True" OnDeleteCommand="RadGrid1_DeleteCommand" OnItemCommand="RadGrid1_ItemCommand1"
                    OnUpdateCommand="RadGrid1_UpdateCommand" OnItemDataBound="RadGrid1_ItemDataBound">
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                    </HeaderContextMenu>
                    <MasterTableView ShowFooter="True" DataKeyNames="OrderProducts,IDStatus,ID" EditMode="InPlace">
                        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>
                        <DetailTables>
                            <telerik:GridTableView DataKeyNames="ID" Name="Orders" Width="100%" ShowFooter="True">
                                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="OrderProducts" FilterControlAltText="Filter column3 column"
                                        HeaderText="Mã đơn hàng" UniqueName="column3">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="NameVN" FilterControlAltText="Filter column2 column"
                                        HeaderText="Tên sản phẩm" UniqueName="column2">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridImageColumn DataImageUrlFields="Image" DataImageUrlFormatString="/Uploads/Images/{0}"
                                        FilterControlAltText="Filter column column" HeaderText="Ảnh" ImageAlign="Middle"
                                        ImageHeight="100px" ImageWidth="80px" UniqueName="column">
                                    </telerik:GridImageColumn>
                                    <telerik:GridBoundColumn DataField="Quantity" FilterControlAltText="Filter column5 column"
                                        HeaderText="Số lượng" UniqueName="column5">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Price" FilterControlAltText="Filter column6 column"
                                        HeaderText="Giá" UniqueName="column6" DataFormatString="{0:###,### VNĐ}">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridCalculatedColumn Aggregate="Sum" DataFields="Price,Quantity" DataFormatString="{0:###,### VNĐ}"
                                        DataType="System.Double" Expression="{0}*{1}" FilterControlAltText="Filter column column"
                                        HeaderText="Tổng" UniqueName="column1">
                                    </telerik:GridCalculatedColumn>
                                </Columns>
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                            </telerik:GridTableView>
                        </DetailTables>
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1"
                                FilterControlAltText="Filter EditCommandColumn1 column">
                                <ItemStyle CssClass="MyImageButton" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridDateTimeColumn DataField="DateTime" DataFormatString="{0:dd/MM/yyyy}"
                                DataType="System.DateTime" FilterControlAltText="Filter column1 column" HeaderText="Ngày order"
                                UniqueName="DateTime" FilterControlWidth="100px">
                            </telerik:GridDateTimeColumn>
                            <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="Status" GroupByExpression="NameVN Status Group By NameVN"
                                UniqueName="IDStatus">
                                <ItemTemplate>
                                    <%#DataBinder.Eval(Container.DataItem, "NameVN")%>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox runat="server" ID="radcbbStatus">
                                    </telerik:RadComboBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="Bill_Name" FilterControlAltText="Filter column4 column"
                                HeaderText="Bill Name" UniqueName="Bill_Name">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Bill_Address" FilterControlAltText="Filter column5 column"
                                HeaderText="Bill Address" UniqueName="Bill_Address">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Bill_Phone" FilterControlAltText="Filter column6 column"
                                HeaderText="Bill Phone" UniqueName="Bill_Phone">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Ship_Name" HeaderText="Ship Name" HeaderButtonType="TextButton"
                                DataField="Ship_Name" UniqueName="Ship_Name">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Ship_Address" HeaderText="Ship Address"
                                HeaderButtonType="TextButton" DataField="Ship_Address" UniqueName="Ship_Address">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Ship_Phone" HeaderText="Ship Phone" HeaderButtonType="TextButton"
                                DataField="Ship_Phone" UniqueName="Ship_Phone">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Ship_City" FilterControlAltText="Filter column2 column"
                                HeaderText="Thành phố" UniqueName="Ship_City">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Notes" FilterControlAltText="Filter column column"
                                HeaderText="Ghi chú" UniqueName="Notes">
                            </telerik:GridBoundColumn>
                            <telerik:GridButtonColumn CommandName="Delete" FilterControlAltText="Filter column column"
                                Text="Delete" UniqueName="column">
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings>
                            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                            <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                                Width="100%" />
                            <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                            <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                            <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
                                UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                            </EditColumn>
                            <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                        </EditFormSettings>
                    </MasterTableView>
                    <ClientSettings AllowDragToGroup="True">
                        <Scrolling AllowScroll="True" />
                    </ClientSettings>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                </telerik:RadGrid>
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:HiddenField ID="hdCate" runat="server" />
            </td>
        </tr>
        <tr>
            <td align="center">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td align="center">
                &nbsp;
            </td>
        </tr>
    </table>
    <div>
    </div>
</asp:Content>
